package com.arlen.security_oauth2_1.controller;


import org.springframework.http.HttpRequest;
import org.springframework.security.core.Authentication;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletRequest;

@RestController
@RequestMapping("/user")
public class UserController {

    @RequestMapping("getCurrentUser")
    public String getCurrentUser(Authentication authentication, HttpServletRequest request) {
        return authentication.toString() + "||" + request.toString();
    }
}
